home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Review 28
/
Creative-Review-CD-ROM-28.iso
/
pc
/
kungfu
/
assets
/
game.dir
/
00053_Script_video clip class
< prev
next >
Wrap
Text File
|
1997-08-08
|
4KB
|
199 lines
-- video clip class method
-- --------------------------------------------------
property stay
property in
property out
property videonum
property videoname
property videofile
property platformseperator
property folderpath
property rate
property looped
property callbackflag
property mode
property channel
property checkgap
property updategap
property checkearly
property duration
property draw
-- --------------------------------------------------
global gtime, gcallback
-- ==================================================
-- new method
-- --------------------------------------------------
on new me, props
minit me, props
return me
end mnew
-- ==================================================
-- minit method
-- --------------------------------------------------
on minit me, props
-- put "in minit video clip"
list2object ( props, me )
set duration = out - in
set mode = #stop
set callbackflag = false
set checkgap = 1
set updategap = 0
set checkearly = 5
set stay = false
if the machinetype = 256 then
set platformseperator = "\"
else
set platformseperator = ":"
end if
set folderpath = "video" & platformseperator
if voidp ( rate ) then set rate = true
-- put "out minit video clip"
end minit
-- ==================================================
-- mplay method
-- --------------------------------------------------
on mplay me, checkhang
-- put "in mplay video clip"
set mode = #play
set callbackflag = true
set stay = false
set thefilepath = the moviepath & folderpath & videofile
if not ( the filename of cast ( the castname of draw ) = thefilepath ) then
set the filename of cast ( the castname of draw ) = thefilepath
end if
-- put "--------------------"
-- put videofile
-- put thefilepath
-- put the filename of cast ( the castname of draw )
-- put "--------------------"
mhide draw
updatestage
set channel = the channel of draw
set the movietime of sprite channel = in
updatestage
mdraw draw
set the movierate of sprite channel = rate
updatestage
if checkhang then set nextupdate = the timer + 20
else set nextupdate = the timer + duration - checkearly
maddtask gtime, me, nextupdate
set updategap = checkgap
-- put "out mplay video clip", videoname
end mplay
-- ==================================================
-- mstop method
-- --------------------------------------------------
on mstop me
-- put "in mstop video clip"
set mode = #stop
set the movierate of sprite channel = false
mhide draw
set channel = 0
mdeletetasks gtime, me
set updategap = 0
if callbackflag then
-- put "video clip stop callback"
mcallback (gcallback)
end if
set callbackflag = false
-- put "out mstop video clip", videoname
end mstop
-- ==================================================
-- mabort method
-- --------------------------------------------------
on mabort me
put "in mabort video clip", videoname
set mode = #stop
set the movierate of sprite channel = false
if not stay then set the castnum of me = 0
set channel = 0
mdeletetasks gtime, me
set updategap = 0
set callbackflag = false
put "out mabort video clip", videoname
end mabort
-- ==================================================
-- mdotask method
-- --------------------------------------------------
on mdotask me
-- put "in mdotask video clip"
-- put the movietime of sprite channel, in, out
-- put "rate: " , the movierate of sprite channel
if the movietime of sprite channel >= out then
if mode = #play then mstop me
return false
end if
if not ( the movierate of sprite channel = rate ) then
set the movierate of sprite channel = rate
put "******* video hung and restarted *******"
end if
-- put "out mdotask video clip"
return updategap
end mdotask
-- --------------------------------------------------